﻿using Factory;
using IDAL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class B_Account : IAccount
    {
        public void Add(Account item)
        {
            CreateFactory.GetAccount().Add(item);
        }

        public void Delete(int id)
        {
            CreateFactory.GetAccount().Delete(id);
        }

        public Account FindById(int id)
        { 
            return CreateFactory.GetAccount().FindById(id);
        }

        public List<Account> GetAll()
        {
            return CreateFactory.GetAccount().GetAll();
        }

        public void Updata(int id, Account item)
        {
            CreateFactory.GetAccount().Updata(id, item);
        }

        public bool HasUserName(string username)
        {
            return CreateFactory.GetAccount().HasUserName(username);
        }
        public int Login(string username, string password)
        {
            return CreateFactory.GetAccount().Login(username, password);
        }

        public void Updata(int id, Order order)
        {
            throw new NotImplementedException();
        }
    }
}
